<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>品牌列表-${setting.name}</title> [#include "/common/include.ftl"/]
<link rel="stylesheet" href="${base}/resource/css/promotion.css">
<link rel="stylesheet" href="${base}/resource/css/point_content.css">
<link rel="stylesheet" href="${base}/resource/css/point.css">

<script src="${base}/resource/js/unslider.min.js"></script>
</head>
<body class="customer">

	[#include "common/header.ftl"]
	<div class="Pgoods_main">

		<!--left-->
		[#include "intergral/left.ftl"]
		<!--right-->
		<div class="Pgoods_main_right">
			<div class="main_right_tit">
				<a
					href="${base}/intergral/index.jhtml?classId=${detail.shopClassId}">&lt;返回商品列表</a>
			</div>

			<div class="main_right_detail">
				<div class="right_detail_left">
					<img class="lazy" data-original="[@Pic pic=detail.litpic /]"
						width="200" height="230">
				</div>
				<div class="right_detail_right">
					<p>${detail.name}</p>
					<!--  <dl><dt>市场价：</dt> <dd><font>￥100.00元</font></dd></dl> -->
					<dl>
						<dt>积&nbsp;&nbsp;分：</dt>
						<dd>
							<font>${detail.price}分</font>
						</dd>
					</dl>
					<!-- <dl><dt>库&nbsp;&nbsp;存：</dt> <dd>有货</dd></dl> -->
					<dl>
						<dt>剩余数量：</dt>
						<dd>${detail.num-detail.sale_num}</dd>
					</dl>
					<!--  <dl><dt>收货人：</dt> <dd> <input type="text" value="" /><small>*填写您的收件人姓名</small></dd></dl>
                 <dl><dt>手&nbsp;&nbsp;机：</dt> <dd><input type="text" value="" /><small>*填写您的收件人联系方式</small></dd></dl>
                 <dl><dt>地&nbsp;&nbsp;址：</dt> <dd> <input type="text" value="" style="width:260px;"/><small>&nbsp;</small></dd></dl> -->

					<dl>
						<dt>兑换数量：</dt>
						<dd>
							<input type="text" value="1" id="num" name="num" maxlength="10"
								onkeyup="value=value.replace(/[^\d]/g,'')"><small>*填写兑换数量</small>
						</dd>
					</dl>
					<dl>
						<dt>收货人：</dt>
						<dd>
							<input type="text" value="" id="name" name="name" maxlength="20"><small>*填写您的收件人姓名</small>
						</dd>
					</dl>
					<dl>
						<dt>手&nbsp;&nbsp;机：</dt>
						<dd>
							<input type="text" value="" id="phone" name="phone"
								maxlength="20" onkeyup="value=value.replace(/[^\d]/g,'')"><small>*填写您的收件人联系方式</small>
						</dd>
					</dl>
					<dl>
						<dt>地&nbsp;&nbsp;址：</dt>
						<dd>
							<input type="text" value="" id="address" style="width: 260px;"
								name="address" maxlength="50"><small>&nbsp;</small>
						</dd>
					</dl>
					<input type="hidden" name="id" value="${detail.id}"> <input
						type="hidden" name="price" value="${detail.price}">
					<dl>
						<dd>
							<button onclick="buy()" value="" style="width: 260px;">确认兑换</button>
							<small>&nbsp;</small>
						</dd>
					</dl>

				</div>
				<div class="clear"></div>
			</div>

			<div class="main_right_info">
				<p class="main_Rinfo_tit">商品详情</p>
				${detail.content}
			</div>
		</div>
		<!--right end-->
		<div class="clear"></div>
	</div>
	<script>
function buy(){
	var num  = $('#num').val();
	var name  = $('#name').val();
	var phone  = $('#phone').val();
	var address  = $('#address').val();
	
	if(num==""){
		oDialog.prompt("请输入您需要兑换的数量");
		return;
	}
	if(name==""){
		oDialog.prompt("请输入您的名字");
		return;
	}
	if(phone==""){
		oDialog.prompt("请输入您的手机号码");
		return;
	}
	if(address==""){
		oDialog.prompt("请输入您的地址");
		return;
	}
			$.ajax({
				url : base + "/intergral/submit.jhtml",
				type : "POST",
				dataType : "json",
				data : {
					productId :${detail.id},
					name : name,
					phone : phone,
					num : num,
					address : address
				},
				cache : false,
				success : function(data) {
					if (data.error == undefined || data.error == '') {
						oDialog.prompt(data.success);
						
					} else {
						oDialog.prompt(data.error);
						
					}
				}
			});
	
	
}


</script>




	[#include "common/footer-slidebar-lazyload.ftl"]
</body>
</html>